#include<sys/types.h>
#include"blockingqueue.h"

typedef struct threadpool{
    blockingqueue *bq;
    pthread_t* threads;
    u_int32_t max_thread_num;
    u_int32_t busy_thread_num;
    u_int32_t live_thread_num;
    int is_shutdown;
}threadpool;

typedef struct worker{
    void* data;
    void (*work)(void*);
    threadpool* pool;
}worker;

extern threadpool* create_threadpool(u_int32_t);

extern void execute_threadpol(worker* );

extern void shutdown_threadpool(threadpool*);

extern void destory_threadpool(threadpool*);
